<?php
	$css_list[0]['url'] = './tpl/css/setting.css';
	$js_list[0] = './public/js/city.js';
?>
<!--{template inc/header_n}-->
<div id="body" class="fm960">
	<div class="piece1">
		<div class="piece1_hd"></div>
		<div class="piece1_bd clearfix">
			<div style="width:1180px;">
				<!--{template inc/settings/settings_menu}-->
				<div id="setting_box" class="fl">
					<div id="setting_form" class="setting_basic">
                        <h3>{$item['name']}{if $item['isstop']==0}[{if $item['flag']}已完成{else}未完成{/if}]{else}[<span style="color:red;">交易停止</span>]{/if}</h3>
                        {if $item['isstop']==1}
                        <p style="color:red;">提示：该订单用户申请了退款 商家已同步退款!</p>
                        {/if}
                        <p>买家{$user['user_name']}!</p>
                        <table class="table_list" width="100%" cellspacing="1" border="0">
                            <?php $flag = false; ?>
                            {loop $item['items'] $k $v}
                            <tr>
                                <td>{$v['name']}</td>
                                {if isset($item['data'][$k])}
                                <td><?php echo date('Y-m-d H:i:s', $item['data'][$k]['dateline']);?></td>
                                <td>
                                    {$v['tips'][$item['data'][$k]['tipid']]}
                                    <p style="color:blue;">{$item['data'][$k]['tip']}</p>
                                </td>
                                <td>已完成</td>
                                <td>-</td>
                                <td>-</td>
                                {else}
                                <td>-</td>
                                <td>-</td>
                                <td>未完成</td>
                                {if !$flag}
                                <td>
                                    {if !$item['isstop'] && !$item['unpay']}
                                    <select id="tip_{$k}">
                                        <option value="-1">请选择寄语</option>
                                        {loop $v['tips'] $k1 $v1}
                                        <option value="{$k1}">{$v1}</option>
                                        {/loop}
                                    </select><br/>
                                    <textarea id="tipval_{$k}" style="width:150px;height:50px;margin-top:5px;"></textarea>
                                    {else}
                                    -
                                    {/if}
                                </td>
                                <td>
                                    {if !$item['isstop'] && !$item['unpay']}
                                    <input type="button" style="padding:2px 6px;width:60px;height:31px;font-size:14px;" class="green_button" value="完成" onclick="docomp({$k}, this)"/>
                                    {else}
                                    -
                                    {/if}
                                </td>
                                {else}
                                <td>-</td>
                                <td>-</td>
                                {/if}
                                <?php $flag = true; ?>
                                {/if}
                            </tr>
                            {/loop}
                        </table>
					</div>
				</div>
			</div>
		</div>
		<div class="piece1_ft"></div>
	</div>
	
	<div class="huoguojun2" id="huoguojun"><a href="/list.php?action=robot"><img src="/public/v1/img/huoguojun.png"></a></div>
    <div class="i_notice2">
        <div class="j_title">公告栏</div>
        <div class="j_list">
            <ul>
                <li><a href="#"><span style="color:red;">泡泡火锅加盟,提供个大卫视广告宣传</span></a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
                <li><a href="#">泡泡火锅加盟,提供个大卫视广告宣传</a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
            </ul>
        </div>
    </div>
</div>
<!--{template inc/footer}-->
<script type="text/javascript">
function docomp(itemid, obj) {
    var tipid = $('#tip_'+itemid).val();
    if(-1 == tipid) {
        alert('请选择寄语');
        return;
    }
    $.post('/shareinfo.php?action=wu', {docomp : 1, itemid : itemid, id : {$item['item_id']}, tipid : tipid, tip : $('#tipval_'+itemid).val()}, function(s){
        if('1' == s) {
            location.reload();
        } else {
            alert('操作失败，请重试');
        }
    });
}
</script>